<extend name="Base/common"/>

<block name="header"></block>

<block name="body">
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">配线间位置</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>

            <!-- 位置 -->
            <div class="row">
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                添加机房位置
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <form name="form1" id="form1" role="form" action="{:U('Home/Settings/update')}" method="post">
                                            <div class="form-group" id="xiaoqu">
                                                <label>校区</label>
                                                <volist name="arealist" id="vo">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="optionsRadiosInline" id="optionsRadiosInline1" value="{$vo.id}">{$vo.name}
                                                    </label>
                                                </volist>
                                            </div>
                                            <div class="form-group col-lg-6">
                                                <label>选择上级区域</label>
                                                <select class="form-control" name="area" id="area">
                                                    <option value="0" selected="selected">无</option>
                                                    <volist name="arealist" id="vo">
                                                        <option value="{$vo.id}">{$vo.name}</option>
                                                        <foreach name="vo.Buildings" item="Build">
                                                            <option value="{$Build.id}">-- {$Build.name}</option>
                                                            <foreach name="Build.room" item="room">
                                                                <option value="{$room.id}">—— {$room.name}</option>
                                                            </foreach>
                                                        </foreach>
                                                    </volist>
                                                    
                                                </select>
                                                <p class="help-block">将要添加的位置所属的上级区域，<span style="color: red;">一级区域请选“无”</span></p>
                                            </div>
                                            <div class="form-group col-lg-6">
                                                <label>填写配线间名称</label>
                                                <input class="form-control" placeholder="请输入位置名称" value="" name="name">
                                                <p class="help-block">输入配线间 或 区域名称</p>
                                            </div>
                                            <button type="submit" class="btn btn-default">添加</button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
            <!-- 列出区域列表
            <script type="text/javascript">
                $(function(){
                    $(window).resize(function(){
                        $("#main-container").css("min-height", $(window).height() - 343);
                    }).resize();
                })
            </script>          -->
            <!-- 位置结束 -->
            <!-- 巡检内容内容 -->
            <div class="row">
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                机房巡检内容设置
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <form name="form2" id="form2" role="form" action="{:U('Home/Settings/inspectionAttribute')}" method="post">
                                            <!-- name 字段名	type 数据类型	remark 备注	is_show 是否显示	extra 参数 -->
                                            <div class="col-lg-12">
                                                <h1>常规巡检内容设置</h1>
                                                <div class="row">
                                                    <div class="col-lg-6">
                                                        <div class="col-lg-6">
                                                            <div class="form-group input-group">
                                                                <span class="input-group-addon">标识</span>
                                                                <input name="name" type="text" class="form-control" placeholder="name">
                                                            </div>
                                                        </div>
                                                        
                                                        <div class="col-lg-6">
                                                            <div class="form-group input-group">
                                                                <span class="input-group-addon">名称</span>
                                                                <input name="title" type="text" class="form-control" placeholder="title">
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-6">
                                                            <div class="form-group input-group">
                                                                <span class="input-group-addon">数据类型</span>
                                                                <input  name="type" type="text" class="form-control" placeholder="type" value="1">
                                                            </div>
                                                            <p class="help-block">selects:1,Radio:2,Checkboxes:3</p>
                                                        </div>
                                                        <div class="col-lg-6">
                                                            <div class="form-group input-group">
                                                                <span class="input-group-addon">备注</span>
                                                                <input name="remark" type="text" class="form-control" placeholder="remark">
                                                            </div>
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-lg-4">
                                                        <div class="form-group">
                                                            <textarea name="extra" class="form-control" rows="3" placeholder="参数"></textarea>
                                                        </div>
                                                        <p class="help-block">例子：</p>
                                                        <p class="help-block">1:正常</p>
                                                        <p class="help-block">2:报警</p>
                                                    </div>
                                                    <button type="submit" class="btn btn-default">添加</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
              <!-- 巡检内容内容结束 -->

            <!-- 巡检内容列表 -->
            <div class="row">
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                               巡检内容列表
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                            <tr>
                                                <th>id</th>
                                                <th>标识</th>
                                                <th>名称</th>
                                                <th>显示类型</th>
                                                <th>备注</th>
                                                <th>是否显示</th>
                                                <th>列表</th>
                                                <th>编辑</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <volist name="InspectionAttributeList" id="data">
                                                <tr>
                                                    <td>{$data.id}</td>
                                                    <td>{$data.name}</td>
                                                    <td>{$data.title}</td>
                                                    <td>{$data.type}</td>
                                                    <td>{$data.remark}</td>
                                                    <td>{$data.is_show}</td>
                                                    <td>{$data.extra}</td>
                                                    <td>
                                                        <button class="btn btn-primary btn-circle" data-toggle="modal" data-target="#my{$data.name}">
                                                            <i class="fa fa-list"></i>
                                                        </button>
                                                        <!-- Modal -->
                                                        <div class="modal fade" id="my{$data.name}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                                                            <div class="modal-dialog">
                                                                <div class="modal-content">
                                                                    <form name="{$data.name}" id="{$data.name}" role="form" action="{:U('Home/Settings/inspectionAttributeUpdata',array('id'=>$data['id']))}" method="get">
                                                                    <div class="modal-header">
                                                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                                                        <h4 class="modal-title" id="myModalLabel">常规巡检内容设置</h4>
                                                                    </div>
                                                                    <div class="modal-body">
                                                                        
                                                                        <!-- name 字段名	type 数据类型	remark 备注	is_show 是否显示	extra 参数 -->
                                                                        <div class="row">
                                                                            <div class="col-lg-6">
                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group input-group">
                                                                                        <span class="input-group-addon">标识</span>
                                                                                        <input name="name" type="text" class="form-control" value="{$data.name}">
                                                                                    </div>
                                                                                </div>
                                                                                
                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group input-group">
                                                                                        <span class="input-group-addon">名称</span>
                                                                                        <input name="title" type="text" class="form-control" value="{$data.title}">
                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group input-group">
                                                                                        <span class="input-group-addon">数据类型</span>
                                                                                        <input  name="type" type="text" class="form-control" placeholder="type" value="{$data.type}">
                                                                                    </div>
                                                                                    <p class="help-block">selects:1,Radio:2,Checkboxes:3</p>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group input-group">
                                                                                        <span class="input-group-addon">备注</span>
                                                                                        <input name="remark" type="text" class="form-control" placeholder="remark" value="{$data.remark}">
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                            
                                                                            <div class="col-lg-6">
                                                                                <div class="form-group">
                                                                                    <textarea name="extra" class="form-control" rows="3" >{$data.extra}</textarea>
                                                                                </div>
                                                                                <p class="help-block">例子：</p>
                                                                                <p class="help-block">1:正常</p>
                                                                                <p class="help-block">2:报警</p>
                                                                            </div>
                                                                        </div> 
                                                                    </div>
                                                                    <div class="modal-footer">
                                                                        <input class="btn btn-primary" type="submit" value="保存" />
                                                                    </div>
                                                                    
                                                                </form>
                                                                </div>
                                                                <!-- /.modal-content -->
                                                            </div>
                                                            <!-- /.modal-dialog -->
                                                        </div>

                                                        <!-- 删除按钮 -->
                                                        <button class="btn btn-danger  btn-circle" data-toggle="modal" data-target="#del{$data.name}"><i class="fa fa-times"></i>
                                                        </button>
                                                        <!-- Modal -->
                                                        <div class="modal fade" id="del{$data.name}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                                                                <div class="modal-dialog">
                                                                    <div class="modal-content">
                                                                        <form name="{$data.name}" id="{$data.name}" role="form" action="{:U('Home/Settings/inspectionAttributeDelete',array('id'=>$data['id']))}" method="post">
                                                                        <div class="modal-header">
                                                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                                                            <h4 class="modal-title" id="myModalLabel">
                                                                                <span style="color: red;">确定删除 </span> {$data.title}（{$data.name}）</h4>
                                                                        </div>
                                                                        <div class="modal-body">
                                                                            
                                                                            <!-- name 字段名	type 数据类型	remark 备注	is_show 是否显示	extra 参数 -->
                                                                            <div class="row">
                                                                                <fieldset disabled="">
                                                                                <div class="col-lg-6">
                                                                                    <div class="col-lg-12">
                                                                                        <div class="form-group input-group">
                                                                                            <span class="input-group-addon">标识</span>
                                                                                            <input name="name" type="text" class="form-control" value="{$data.name}">
                                                                                        </div>
                                                                                    </div>
                                                                                    
                                                                                    <div class="col-lg-12">
                                                                                        <div class="form-group input-group">
                                                                                            <span class="input-group-addon">名称</span>
                                                                                            <input name="title" type="text" class="form-control" value="{$data.title}">
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <div class="form-group input-group">
                                                                                            <span class="input-group-addon">数据类型</span>
                                                                                            <input  name="type" type="text" class="form-control" placeholder="type" value="{$data.type}">
                                                                                        </div>
                                                                                        <p class="help-block">selects:1,Radio:2,Checkboxes:3</p>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <div class="form-group input-group">
                                                                                            <span class="input-group-addon">备注</span>
                                                                                            <input name="remark" type="text" class="form-control" placeholder="remark" value="{$data.remark}">
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                                
                                                                                <div class="col-lg-6">
                                                                                    <div class="form-group">
                                                                                        <textarea name="extra" class="form-control" rows="3" >{$data.extra}</textarea>
                                                                                    </div>
                                                                                    <p class="help-block">例子：</p>
                                                                                    <p class="help-block">1:正常</p>
                                                                                    <p class="help-block">2:报警</p>
                                                                                </div>
                                                                                </fieldset>
                                                                            </div> 
                                                                        </div>
                                                                        <div class="modal-footer">
                                                                            <input class="btn btn-danger " type="submit" value="确定删除" />
                                                                        </div>
                                                                        
                                                                    </form>
                                                                    </div>
                                                                    <!-- /.modal-content -->
                                                                </div>
                                                                <!-- /.modal-dialog -->
                                                            </div>
                                                    </td>
                                                </tr>
                                            </volist>
                                        </tbody>
                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
            </div>
              <!-- 巡检内容列表结束 -->
        </div>
        <!-- /#page-wrapper -->
</block>
